<html>
<head><meta charset="utf-8"><title>rustc_private crate relying on rustc_llvm · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustc_private.20crate.20relying.20on.20rustc_llvm.html">rustc_private crate relying on rustc_llvm</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="244386216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustc_private%20crate%20relying%20on%20rustc_llvm/near/244386216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustc_private.20crate.20relying.20on.20rustc_llvm.html#244386216">(Jun 30 2021 at 07:25)</a>:</h4>
<p>So, i am in a bit of a pickle im not sure how to solve. I am building a codegen that heavily takes things from rustc_codegen_llvm, it uses some of its types, but it especially uses its LLVM FFI and rustc_llvm wrappers. But... this causes a bit of an issue, im not sure how to get this to build, if i try to build it, i get linker errors for the llvm stuff. Which i guess makes sense because im not building rustc itself, but then how do i get around this? I think id have to clone rustc_llvm or somehow tell rustc to rebuild rustc_llvm every time. Any ideas?</p>



<a name="244386525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustc_private%20crate%20relying%20on%20rustc_llvm/near/244386525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustc_private.20crate.20relying.20on.20rustc_llvm.html#244386525">(Jun 30 2021 at 07:29)</a>:</h4>
<p>im thinking just using rustc_llvm to get it to do the linking for me might work, but i dont think its published on <a href="http://crates.io">crates.io</a> :(</p>



<a name="244478379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustc_private%20crate%20relying%20on%20rustc_llvm/near/244478379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustc_private.20crate.20relying.20on.20rustc_llvm.html#244478379">(Jun 30 2021 at 19:52)</a>:</h4>
<p>I seem to have solved it, i just copied some parts of rustc_llvm's <a href="http://build.rs">build.rs</a> and the llvm wrapper C++ files and it links now. it prob includes tons of stuff i dont need but i can clean that up later. Now i just need to find libnvvm and then i might be able to finally write a Cuda kernel in rust <span aria-label="eyes" class="emoji emoji-1f440" role="img" title="eyes">:eyes:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>